package com.firefightingiot.firefightingiot.web.mapper;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.firefightingiot.firefightingiot.model.DeviceAlarmLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@Mapper
public interface DeviceAlarmLogMapper extends BaseMapper<DeviceAlarmLog> {

    void updateByNumber(JSONObject jsonParam);

    void updateByLogId(JSONObject jsonParam);

    void updateByIds(JSONObject jsonParam);

    List<String> getTodayList(JSONObject jsonParam);

    IPage<DeviceAlarmLog> deviceAlarmLogListPage(IPage page, @Param("param") JSONObject jsonParam);

    int getCountByAlarmType(JSONObject jsonParam);

    List<Map<String, Object>> getCountByDeviceClassify(JSONObject jsonParam);

    List<Map<String, Object>> getWeekAlarm(JSONObject jsonParam);

    List<Map<String, Object>> getRealTimeAlarmList(JSONObject jsonParam);

    List<Map<String, Object>> getVisualizationRealTimeAlarmList(JSONObject jsonParam);

    List<Map<String, Object>> getDeviceCountByCurrentstate(JSONObject jsonParam);

    List<Map<String, Object>> getAlarmBusinessAnalysis(JSONObject jsonParam);
    List<Map<String, Object>> getDeviceAlarmCount(JSONObject jsonParam);

    List<DeviceAlarmLog> getAlarmTypeName(JSONObject jsonParam);

    List<DeviceAlarmLog> getMonthAlarmlog(JSONObject jsonParam);
    int getAlarmDeviceCount(JSONObject jsonParam);

    List<LinkedHashMap<String, String>> exportDeviceAlarmLog(@Param("param") JSONObject jsonParam);
    List<LinkedHashMap<String, String>> exportWaterColumnBoxDataLog(@Param("param") Map<String, Object> params);

    List<Map<String, Object>> getAlarmAnalysisByPlaceForBigData(JSONObject jsonParam);

    List<Map<String, Object>> getAlarmAnalysisByTypeForBigData(JSONObject jsonParam);

    List<Map<String, Object>> getAlarmAnalysisByAreaForBigData(JSONObject jsonParam);

    List<Map<String, Object>> getAlarmLogNumByDeviceClassify(JSONObject jsonParam);

    List<Map<String, Object>> getAlarmLogNumByDeviceTypeForWater(JSONObject jsonParam);

    int getNorMalLogCount(JSONObject jsonParam);

    /**
     * 今天的日志统计：根据报警类型
     * @param jsonParam
     * @return
     */
    List<DeviceAlarmLog> getTodayALarmLogCount(JSONObject jsonParam);

    /**
     * 统计今日报警单位
     * @param jsonParam
     * @return
     */
    List<DeviceAlarmLog> getAlarmBusiness(JSONObject jsonParam);

    /**
     * 校验单位是否过期
     */
    String getExpirationTime(String id);
    /**
     * 查询可视化设备报警日志30分钟以外的数据
     */
    List<DeviceAlarmLog> getVisualizationDeviceLog();
}
